#!/usr/bin/env python3

# Write a recursive function to count the number of items in a list
arr = [1,2,3,4,5,6,7]
def count(arr):
    if len(arr) == 1:
        return 1
    else:
        arr.pop(0)
        return 1 + count(arr)
print(count(arr))

# quick sort
def quick_sort(arr):
    if len(arr) < 2:
        return arr
    else:
        pivot = arr[0]
        less = [i for i in arr[1:] if i < pivot]
        great = [i for i in arr[1:] if i > pivot]
        return quick_sort(less) + [pivot] + quick_sort(great)

arr2 = [13, 2, 5, 28, 10, 36, 11, 7, 9, 26]
sort_arr = quick_sort(arr2)
print(sort_arr)